#ifndef __NETMESSAGE__H__
#define __NETMESSAGE__H__

#include "message.hpp"


#include "nlohmann/json.hpp"
using Json = nlohmann::json;

enum ClientDataType
{
    CDT_CLOSE,              // 客户端关闭
    CDT_LOGIN,
    CDT_REGISTER
};

struct NewClientMessage : public BaseMessage<NewClientMessage>
{
    int         clientFd;
    std::string addr;
    uint16_t    port;
};

struct ClientDataMessage : public BaseMessage<ClientDataMessage>
{
    int         type;
    Json        data;
};

enum ServerCommand
{
    SC_EXIT
};

struct ServerCmdMessage : public BaseMessage<ServerCmdMessage>
{
    int         type;
};

#endif //__NETMESSAGE__H__